package com.gitee.simons.gateway.fallback;

import com.gitee.simons.common.bean.JsonResult;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author jsm
 * @date 2019/1/18 17:12
 * @Description
 */
@RestController
@Slf4j
public class CommonFallback {
    @RequestMapping("/hystrixTimeout")
    public JsonResult<String> hystrixTimeout() {
        String message = "微服务路由请求超时，请刷新重试";
        log.error(message);
        return JsonResult.fail(message);
    }

    @RequestMapping("/authHystrixCommand")
    public JsonResult<String> authHystrixCommand() {
        String message = "微服务路由请求失败，请刷新重试";
        log.error(message);
        return JsonResult.fail(message);
    }
}
